package com.fjec.activity.feign;

import com.fjec.activity.view.SecKillShopVO;
import com.fjec.common.view.ServiceProjectVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "market-serv")
public interface MarketClient {
    @RequestMapping(method = RequestMethod.POST, value = "/api/n/shop/getShopVOsByBusiIds")
    List<Map<String, Object>> getShopVOsByBusiIds(@RequestBody List<Long> busiIds, @RequestParam("userId") Long userId);

    @RequestMapping(method = RequestMethod.GET, value = "/api/n/market/getMarkCodesByBusiId")
    List<Integer> getMarkCodesByBusiId(@RequestParam("busiId") Long busiId, @RequestParam("busiType") Integer busiType);

    @RequestMapping(method = RequestMethod.GET, value = "/api/n/shop/getShopVOsByGivingUserIds")
    String getShopVOsByGivingUserIds(@RequestParam("givingUserIds") String givingUserIds, @RequestParam("userId") Long userId);

    @RequestMapping(method = RequestMethod.GET, value = "/api/serviceproject/getByServType")
    List<Map<String, Object>> getGiftInfo(@RequestParam("servType") int servType);

    @RequestMapping(method = RequestMethod.GET, value = "/api/market/devOps/getByCode")
    Map<String, Object> getMarketByCode(@RequestParam("markCode") Integer markCode);

    @RequestMapping(method = RequestMethod.POST, value = "/api/follow/seckillAutoFollow")
    Integer seckillAutoFollow(@RequestParam("userId") Long userId,
                              @RequestParam("busiId") Long busiId,
                              @RequestParam("busiType") Integer busiType);

    @RequestMapping(method = RequestMethod.GET, value = "/api/business/getUserIdByBusiNameES")
    List<Long> getUserIdByBusiNameES(@RequestParam("title") String title);

    @RequestMapping(method = RequestMethod.POST, value = "/api/business/getBusiNamesByBusiIdOrUserIds")
    List<Map<String, Object>> getBusiNamesByBusiIdOrUserIds(@RequestBody List<Long> busiIdOrUserIds);

    @RequestMapping(method = RequestMethod.POST, value = "/api/serv/order/save")
    Long saveServOrder(@RequestParam("totalPrice") Integer totalPrice,
                       @RequestParam("orderType") Integer orderType,
                       @RequestBody List<Map<String, Object>> productList,
                       @RequestParam("subOpenId") String subOpenId,
                       @RequestParam("userId") Long userId);

    @RequestMapping(method = RequestMethod.POST, value = "/api/serv/order/set/status2")
    int setServOrderStatus2(@RequestParam("orderId") Long orderId);

    /**
     * 根据礼物Ids获取服务
     *
     * @param giftIds
     * @return
     * @throws Exception
     */
    @RequestMapping(method = RequestMethod.GET, value = "/api/service/project/get/by/ids")
    Map<String, ServiceProjectVO> getServiceProjectByIds(@RequestParam("giftIds") String giftIds);

    /**
     * 根据userId查询店铺进件状态
     * 0=未注册商铺
     * 1=基本信息
     * 2=已完善信息
     * 3=已进件
     *
     * @param userId
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/api/rpc/get/shop/regStatus")
    Integer rpcGetShopRegStatusByUserId(@RequestParam Long userId);
}
